<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{ backdrop: 'static', keyboard: !saving }">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="coderule.id">编辑对象</span>
                        <span *ngIf="!coderule.id">创建对象</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')" [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">

                    <div class="row">
                        <div class="col-md-2">
                            <label for="EnCode">对象编号 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="EnCode" #EnCodeInput="ngModel" class="form-control" type="text" readonly name="EnCode" [(ngModel)]="coderule.enCode" required maxlength="32" />
                            <validation-messages [formCtrl]="EnCodeInput"></validation-messages>
                        </div>
                        <div class="col-md-2">
                            <label for="FullName">对象名称 *</label>
                        </div>
                        <div class="form-group col-md-4">
                            <input id="FullName" #FullNameInput="ngModel" type="text" name="FullName" class="form-control" [(ngModel)]="coderule.fullName" required maxlength="32" />
                            <validation-messages [formCtrl]="FullNameInput"></validation-messages>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-2">
                            <label for="Description">备注 </label>
                        </div>
                        <div class="form-group col-md-10">
                            <input id="Description" type="text" name="Description" class="form-control" [(ngModel)]="coderule.description" maxlength="256" />
                        </div>
                    </div>

                    <button type="button" class="btn-primary" style="margin: 3px 5px;" (click)="AddRuleFormart()">添加规则</button>
                    <button type="button" class="btn-info" style="margin: 3px 5px;" (click)="EditRuleFormart()">编辑规则</button>
                    <button type="button" class="btn-warning" style="margin: 3px 5px;" (click)="DeleteRuleFormart()">删除规则</button>

                    <div class="row" style="padding-top: 10px;">
                        <!--<Primeng-TurboTable-Start>-->
                        <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                            <p-table #dataTable [(selection)]="selectedrecord" [value]="codeRuleFormatViewDto" selectionMode="single">
                                <ng-template pTemplate="header">
                                    <tr>
                                        <th style="width:100px">
                                            前缀
                                        </th>
                                        <th style="width:230px">
                                            格式
                                        </th>
                                        <th style="width:100px">
                                            步长
                                        </th>
                                        <th style="width:100px">
                                            初值
                                        </th>
                                        <th style="width:200px">
                                            备注
                                        </th>
                                    </tr>
                                </ng-template>
                                <ng-template pTemplate="body" let-record="$implicit" let-columns="columns">
                                    <tr [pSelectableRow]="record">
                                        <td style="width:100px">
                                            {{record.itemTypeName}}
                                        </td>
                                        <td style="width:230px">
                                            {{record.formatStr}}
                                        </td>
                                        <td style="width:100px">
                                            {{record.stepValue}}
                                        </td>
                                        <td style="width:100px">
                                            {{record.initValue}}
                                        </td>
                                        <td style="width:200px">
                                            {{record.desription}}
                                        </td>
                                    </tr>
                                </ng-template>
                            </p-table>
                        </div>
                        <!--<Primeng-TurboTable-End>-->
                    </div>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">
                        取消
                    </button>
                    <button type="submit" class="btn btn-primary" [disabled]="!userForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <span>保存</span>
                    </button>
                </div>
            </form>
        </div>
    </div>

</div>

<ruleFormatCreateOrEdit #ruleFormatCreateOrEdit></ruleFormatCreateOrEdit>